import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

const routes = [{
  path: '/',
  redirect: '/login'
}, {
  path: '/login',
  name: 'login',
  component: () => import('@/components/login/login.vue')
}, {
  path: '/home',
  name: 'home',
  component: () => import('@/components/home/home.vue'),
  children: [{
    name: 'users',
    path: 'users',
    component: () => import('@/components/users/users.vue'),
  }, {
    name: 'sells',
    path: 'sells',
    component: () => import('@/components/sells/sells.vue'),
  }, {
    name: 'buy',
    path: 'buy',
    component: () => import('@/components/buy/buy.vue'),
  }, {
    name: 'outboard',
    path: 'outboard',
    component: () => import('@/components/outboard/outboard.vue'),
  }
  ]
}]

const router = new Router({
  routes,
  mode: "history"
})

export default router;
